/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { RouteConfig } from 'vue-router'

// 在 studioSideMenu 设置侧边栏的显示

export const DATA_PATH = 'data'
export const MODEL_PATH = 'model'
export const VISUALIZATION_PATH = 'visualization'
export const PREVIEW_PATH = 'preview'
export const TRAINNING_PATH = 'trainning'
export const MODELTRAINNING_PATH = 'create'
export const DATASOURCE_PATH = 'source'
export const MODELCONFIG_PATH = 'config'
export const MODELACCESS_PATH = 'report'
export const GIS_PATH = 'gis'
export const KNOWLEDGE_PATH = 'knowledge'

export const CHILD_ROUTE_METADATA: {
  [path: string]: {
    displayedAsViewButton: boolean
    icon: string
  }
} = {
  [DATA_PATH]: {
    displayedAsViewButton: true,
    icon: 'iconmoxingfenxi',
  },
  [VISUALIZATION_PATH]: {
    displayedAsViewButton: true,
    icon: 'iconkeshifenxi',
  },
  [GIS_PATH]: {
    displayedAsViewButton: true,
    icon: 'iconGisshitu2',
  },
  [KNOWLEDGE_PATH]: {
    displayedAsViewButton: true,
    icon: 'iconkeshifenxi1',
  },
  [PREVIEW_PATH]: {
    displayedAsViewButton: false,
    icon: 'iconicon-chakan-copy',
  },
  [TRAINNING_PATH]: {
    displayedAsViewButton: false,
    icon: 'iconicon-chakan-copy',
  },
  [MODELTRAINNING_PATH]: {
    displayedAsViewButton: false,
    icon: 'iconicon-chakan-copy',
  },
  [DATASOURCE_PATH]: {
    displayedAsViewButton: false,
    icon: 'iconicon-chakan-copy',
  },
  [MODELCONFIG_PATH]: {
    displayedAsViewButton: false,
    icon: 'iconicon-chakan-copy',
  },
  [MODELACCESS_PATH]: {
    displayedAsViewButton: false,
    icon: 'iconicon-chakan-copy',
  },
}

const STUDIO_ROUTE_CONFIG: RouteConfig = {
  path: '/project/:id',
  redirect: '/project/:id/data',
  name: 'Studio',
  component: () =>
    import(
      /* webpackChunkName: "studio-view" */ '../views/studio/StudioView.vue'
    ),
  children: [
    {
      path: DATA_PATH,
      name: '数据视图',
      component: () =>
        import(
          /* webpackChunkName: "data-view" */ '../views/studio/DataView.vue'
        ),
    },
    {
      path: VISUALIZATION_PATH,
      name: '系统构建',
      component: () =>
        import(
          /* webpackChunkName: "visualization-view" */ '../views/studio/VisualizationView.vue'
        ),
    },
    {
      path: GIS_PATH,
      name: '时空分析',
      component: () =>
        import(
          /* webpackChunkName: "graph-view" */ '../views/studio/GisView.vue'
        ),
    },
    // {
    //   path: KNOWLEDGE_PATH,
    //   name: '多源异构',
    //   component: () =>
    //     import(
    //       /* webpackChunkName: "knowledge-view" */ '../views/studio/KnowledgeView.vue'
    //     ),
    // },
    {
      path: TRAINNING_PATH,
      name: '模型训练',
      // meta: {
      //   keepAlive: true
      // },
      component: () =>
        import(
          /* webpackChunkName: "trainning-view" */ '../views/studio/TrainningView.vue'
        ),
    },
    {
      path: MODELTRAINNING_PATH,
      name: '模型训练-创建模型',
      component: () =>
        import(
          /* webpackChunkName: "trainning-view" */ '../components/studio/data/model/ModelTrainning.vue'
        ),
    },
    {
      path: DATASOURCE_PATH,
      name: '模型训练-数据表',
      component: () =>
        import(
          /* webpackChunkName: "trainning-view" */ '../components/studio/data/model/DataSource.vue'
        ),
    },
    {
      path: MODELCONFIG_PATH,
      name: '模型训练-查看配置',
      component: () =>
        import(
          /* webpackChunkName: "trainning-view" */ '../components/studio/data/model/ModelConfig.vue'
        ),
    },
    {
      path: MODELACCESS_PATH,
      name: '模型训练-评估报告',
      component: () =>
        import(
          /* webpackChunkName: "trainning-view" */ '../components/studio/data/model/ModelReport.vue'
        ),
    },
  ],
}

export default STUDIO_ROUTE_CONFIG
